//
//  CYBaseModel+CYExchange.h
//  SafetyInHand
//
//  Created by admin on 2022/7/27.
//

#import "CYBaseModel.h"

NS_ASSUME_NONNULL_BEGIN

@interface CYBaseModel (CYExchange)
// ============ 常用方法  =============
/// 模型转字典
- (NSDictionary *)cy_toKeyValue;
/// 常用字典 -> Model, 注意: keyValue 可以是 NSDictionary, NSData, NSString
+ (instancetype)cy_modelFromKeyValue:(id)keyValue;
/// Models - > 数组
+ (NSArray *)cy_keyValuesFromModels:(NSArray *)models;
/// 数组数据 -> Models
+ (NSArray *)cy_modelsFromKeyValues:(NSArray *)keyvalues;

/// 模型转json
- (NSString *)cy_toJson;
@end

NS_ASSUME_NONNULL_END
